package com.lisp.springframework.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.google.common.collect.ImmutableMap;

@Controller
public class IndexController {

	@RequestMapping("/index")
	public ModelAndView index(String name) {
		return new ModelAndView("/index");
	}
	
	@RequestMapping("/test")
	public ModelAndView test(String name) {
		return new ModelAndView("/resources/test.htm");
	}
	
	@RequestMapping("/hello")
	@ResponseBody
	public ImmutableMap<String, Object> hello(String name) {
		return ImmutableMap.of("name", "lisp", "age", 27);
	}
}
